from pydantic import BaseModel, Field
from typing import Optional, List, Dict, Any

# 用户认证模型
class UserLogin(BaseModel):
    username: str
    password: str

class Token(BaseModel):
    access_token: str
    token_type: str

class TokenData(BaseModel):
    username: Optional[str] = None

# 节点查询模型
class SearchRequest(BaseModel):
    query: str

class NodeProperty(BaseModel):
    name: Optional[str] = None
    content: Optional[str] = None
    # 可以添加其他可能的属性

class NodeUpdateRequest(BaseModel):
    node_id: int
    properties: Dict[str, Any]
